/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package renderers;

import javax.swing.DefaultListCellRenderer;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import model.Marka;
import model.Module;

/**
 *
 * @author admin
 */
public class markaComboBoxRenderer extends DefaultListCellRenderer
{
    @Override
    public Component getListCellRendererComponent(
            JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
    {
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        if (value instanceof Marka)
          {
            Marka mec = (Marka) value;
            
           // System.out.println(mec.getNameMarkas());
            
            String txt = mec.getNameMarkas();
            setText(txt);
          }
        return this;
    }
    
}
